/*
 * *
 *  * Copyright (c) iwindplus Technologies Co., Ltd.2024-2030, All rights reserved.
 *
 *
 */

package com.iwindplus.mgt.server.web;

import com.iwindplus.boot.domain.vo.ResultVO;
import com.iwindplus.boot.web.controller.BaseController;
import com.iwindplus.mgt.domain.dto.InitDataDTO;
import com.iwindplus.mgt.server.service.InitService;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 初始化相关操作接口定义类.
 *
 * @author zengdegui
 * @since 2020/9/20
 */
@Tag(name = "初始化接口")
@Slf4j
@RestController
@Hidden
@RequestMapping("init")
@Validated
public class InitController extends BaseController {

    @Resource
    private InitService initService;

    /**
     * 初始化数据.
     *
     * @param entity 对象
     * @return ResultVO < Boolean>
     */
    @Operation(summary = "初始化数据")
    @PostMapping("initData")
    public ResultVO<Boolean> initData(@RequestBody @Validated InitDataDTO entity) {
        Boolean data = this.initService.initData(entity);
        return ResultVO.success(data);
    }
}
